const url = require('url');

let data = 'http://www.baidu.com?name=kkk&age=35';
console.log(url.parse(data));

// 加true后会把字符串解析为json对象
console.log(url.parse(data, true));

let par = url.parse(data, true).query;
console.log('======================');
console.log(par);
console.log(par.name);
console.log(par.age);

